<template>
  <div class="action-bar">
    <!-- 点赞按钮 -->
    <div class="action-button" @click="likeVideo">
      <van-icon name="like-o" color="#ff5757" size="28px" />
      <van-badge :content="likes" class="badge" />
    </div>
    <!-- 评论按钮 -->
    <div class="action-button" @click="commentVideo">
      <van-icon name="comment-o" color="#fff" size="28px" />
      <van-badge :content="comments" class="badge" />
    </div>
  </div>
</template>

<script setup>
const props = defineProps({
  likes: { type: Number, default: 0 },
  comments: { type: Number, default: 0 },
});

const emit = defineEmits(['like', 'comment']);

const likeVideo = () => {
  emit('like');
};

const commentVideo = () => {
  emit('comment');
};
</script>

<style scoped>
.action-bar {
  position: absolute;
  right: 20px;
  top: 65%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.action-button {
  position: relative;
  text-align: center;
  cursor: pointer;
}

.badge {
  position: absolute;
  top: 38px;
  right: 12px;
}
</style>
